(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.process.processConfig.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'processConfigService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, processConfigService) {
		var ctrl = this, processConfigInfo = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;

		ctrl.init = function() {
			var params = {
					wfproccfgId : processConfigInfo.wfproccfgId
			};
			ctrl.innerGridOptions = gridService.createInnerGridOptions($scope, ctrl.layoutConfig.formConfigs.variablesCfg.tableConfigs.table);
			ctrl.innerGridOptions.data = 'vm.processConfig.variables';
			ctrl.innerGridOptions.enableRowHeaderSelection = false;
			authService.view(params).then(function(response) {
				ctrl.processConfig = response.data || processConfigInfo;
			});
		};
		
	}
})(angular);